<template>
  <ContainerGroup>
    <Container style="margin-bottom:10px;">
      <FilterForm
        ref="filterForm"
        :elements="filterElements"
        @submit="handleSearch"
        @reset="handlerReset"
      />
    </Container>
    <Container height="fill" display="flexY">
      <Table
        :columns="tableColumns"
        :loading="tableLoading"
        :data="tableData"
        :pagination="{
          total: total,
          current: currentPage,
          pageSize: pageSize,
        }"
        @paginationChange="pageChange"
      />
    </Container>
  </ContainerGroup>
</template>
<script>
export default {
  name: 'DeleteJournal', // 删除日志
  data() {
    return {
      filterElements: [
        {
          key: 'wardCode',
          type: 'input',
          label: '操作人',
          value: ''
        },
        {
          key: 'edExtraFirstCode',
          type: 'Select',
          label: '操作模块',
          value: '',
          width: 210,
          itemLabel: 'deptName',
          itemValue: 'deptCode',
          options: [],
          filterable: true,
          clearable: true
        },
        {
          key: 'yearMonth',
          label: '操作时间',
          mode: 'daterange',
          type: 'date-picker',
          format: 'yyyy-MM-dd',
          value: [this.$util.currentDate(), this.$util.currentDate()],
          width: 340
        }
      ],
      tableColumns: [
        {
          title: '操作人',
          dataIndex: 'wardName'
        },
        {
          title: 'IP',
          dataIndex: 'n0Count'
        },
        {
          title: '操作模块',
          dataIndex: 'n1Count'
        },
        {
          title: '操作内容',
          dataIndex: 'n2Count'
        },
        {
          title: '操作时间',
          width: 160,
          dataIndex: 'caozuo'
        }
      ],
      total: 0,
      pageSize: 10,
      currentPage: 1,
      tableLoading: false,
      tableData: [],
      newCondition: {}
    }
  },
  created() {},
  methods: {
    handleSearch(value) {
      this.searchInfo = value
      this.currentPage = 1
      this.getData(value)
    },
    getData(value) {
      const params = {
        ...value,
        pageNum: this.currentPage,
        pageSize: this.pageSize
      }
      // this.tableLoading = true
      // getUserReportWithNurseLevel(params).then((res) => {
      //   this.tableLoading = false
      //   if (res.data.code === 200) {
      //     this.tableData = res.data.data.list
      //     this.total = res.data.data.total
      //   } else {
      //     this.$message.error(res.data.message)
      //   }
      // }).catch(() => {
      //   this.tableLoading = false
      // })
    },
    handlerReset(val) {
      this.handleSearch()
    },
    pageChange(payload) {
      this.currentPage = payload.current
      this.pageSize = payload.pageSize
      this.getData()
    }
  }
}
</script>
<style lang="less" scoped>
</style>
